//
//  UITableViewCell+Utils.m
//  KKMYForU
//
//  Created by 黄磊 on 13-11-20.
//  Copyright (c) 2013年 黄磊. All rights reserved.
//

#import "UITableViewCell+Utils.h"

@implementation UITableViewCell (Utils)

@dynamic delegate;

- (void)setDelegate:(id<TableViewCellDelegate>)delegate
{
    // need be overwrite
    LogInfo(@"This function need be overwrite by [%@]", NSStringFromClass([self class]));
}

- (void)configWithData:(id)data
{
    // need be overwrite
    LogInfo(@"This function need be overwrite by [%@]", NSStringFromClass([self class]));
    if ([data isKindOfClass:[NSDictionary class]]) {
        NSDictionary *aDic = (NSDictionary *)data;
        [self.textLabel setText:[aDic objectForKey:@"cellTitle"]];
        NSString *subTitle = [aDic objectForKey:@"subTitleUpdate"];
        if (subTitle == nil)
        {
            subTitle = [aDic objectForKey:@"subTitle"];
        }
        [self.detailTextLabel setText:subTitle];
    }
}

@end
